/**
 * Created by tzx on 2016/11/30.
 */
var express = require('express');
var fs =require("fs");
var router = express.Router();


var getJsonFileData = function (filename,callback) {
    var filePath = function (filename) {
        var Path = "public/data/"+filename + '.json';
        console.log("--------:FileName:--------:"+Path);
        return Path;
    };
    fs.readFile(filePath(filename),function (err,data) {
        if (err) throw err;
        var jsonObj = JSON.parse(data);
        callback(jsonObj);

    });
}


exports.getJsonFileData = getJsonFileData;